package Review2;

import java.util.LinkedList;


public class Test23 {
    public void layerTraverse(BinaryTreeNode root){
    	if(root==null){
    		return;
    	}
    	LinkedList<BinaryTreeNode> list = new LinkedList<BinaryTreeNode>();
    	list.add(root);
    	while(!list.isEmpty()){
    		BinaryTreeNode p = list.remove();
    		System.out.println(p.value);
    		if(p.left!=null){
    			list.add(p.left);
    		}
    		if(root.right!=null){
    			list.add(p.right);
    		}
    	}
    	
    }
}
